const http = require('http');
http.createServer((req,res)=>{
    console.log(req.headers)
    //如果客户端请求路径为/users的话 /api/users
    if(req.url === '/users'){
        res.end(JSON.stringify([{id:1,name:'zhufeng1'}]));
    }else{//否则 就是404
        res.end('404');
    }
}).listen(3000,()=>console.log(3000));
// node server.js

